package com.ninthgroup.controller;



import com.ninthgroup.util.UploadUtil;
import com.ninthgroup.vo.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;


@Controller //@Controller+@ResponseBody
@RequestMapping("/upload")
public class UploadController {


    //该接口只处理
//    @RequestMapping(value = "/" ,method = RequestMethod.POST )
    @RequestMapping("/up")
    @ResponseBody
    public Result upload(MultipartFile file) throws Exception {
        String path = UploadUtil.ossUpload(file);
        return new Result(200,"上传成功",path);
    }
}
